package com.cow.controller;

import com.cow.service.SpecsService;
import com.cow.util.general.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/specs")
public class SpecsController {
    @Autowired
    private SpecsService specsService;

    @GetMapping("/findAllNamesByProId")
    public CommonResult  findAllNamesByProId(@RequestParam(required = true) Integer productId){
        List<String> names = specsService.findAllNamesByProId(productId);
        return CommonResult.success("商品规格名称查询成功",names);
    }
}
